home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / utility1 / gs261src.zip / GSIO.H < prev    next >
C/C++ Source or Header  |  1993-05-13  |  2KB  |  56 lines

  1. /* Copyright (C) 1989, 1990, 1993 Aladdin Enterprises.  All rights reserved.
  2.  
  3. This file is part of Ghostscript.
  4.  
  5. Ghostscript is distributed in the hope that it will be useful, but
  6. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  7. to anyone for the consequences of using it or for whether it serves any
  8. particular purpose or works at all, unless he says so in writing.  Refer
  9. to the Ghostscript General Public License for full details.
  10.  
  11. Everyone is granted permission to copy, modify and redistribute
  12. Ghostscript, but only under the conditions described in the Ghostscript
  13. General Public License.  A copy of this license is supposed to have been
  14. given to you along with Ghostscript so you can know your rights and
  15. responsibilities.  It should be in a file named COPYING.  Among other
  16. things, the copyright notice and this notice must be preserved on all
  17. copies.  */
  18.  
  19. /* gsio.h */
  20. /* stdio redirection for Ghostscript library */
  21.  
  22. /* Ghostscript never uses stdin/out/err directly. */
  23. extern FILE *gs_stdin, *gs_stdout, *gs_stderr;
  24.  
  25. /* Redefine all the relevant stdio functions to use the above. */
  26. /* Some functions we make illegal, rather than redefining them. */
  27. #undef stdin
  28. #define stdin gs_stdin
  29. #undef stdout
  30. #define stdout gs_stdout
  31. #undef stderr
  32. #define stderr gs_stderr
  33. #undef fgetchar
  34. #define fgetchar() fgetc(stdin)
  35. #undef fputchar
  36. #define fputchar(c) fputc(c, stdout)
  37. #undef getchar
  38. #define getchar() getc(stdin)
  39. #undef gets
  40. #define gets Function._gets_.unavailable
  41. /* We should do something about perror, but since many Unix systems */
  42. /* don't provide the strerror function, we can't.  (Neither the */
  43. /* Ghostscript kernel nor any Aladdin-maintained driver uses perror.) */
  44. #undef printf
  45. #define printf Function._printf_.unavailable
  46. #undef putchar
  47. #define putchar(c) fputc(c, stdout)
  48. #undef puts
  49. #define puts(s) (fputs(s, stdout), putchar('\n'))
  50. #undef scanf
  51. #define scanf Function._scanf_.unavailable
  52. #undef vprintf
  53. #define vprintf Function._vprintf_.unavailable
  54. #undef vscanf
  55. #define vscanf Function._vscanf_.unavailable
  56.